Skip to content

feat: 管理面板 SSO;管理相关接口鉴权 - #524

Open
Becks723 wants to merge 10 commits into
west2-online:mainfrom
Becks723:feat/admin-sso
Open

feat: 管理面板 SSO;管理相关接口鉴权#524
Becks723 wants to merge 10 commits into
west2-online:mainfrom
Becks723:feat/admin-sso

Conversation

@Becks723

@Becks723 Becks723 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

自查 PR 结构

  • PR 标题符合这个格式: <type>(optional scope): <description>

  • 此 PR 标题的描述以用户为导向,足够清晰,其他人可以理解。

  • 我已经对所有 commit 提供了签名(GPG 密钥签名、SSH 密钥签名)

  • 这个 PR 属于强制变更/破坏性更改

如果是,请在 PR 标题中添加 BREAKING CHANGE 前缀,并在 PR 描述中详细说明。

这个 PR 的类型是什么?

这个 PR 做了什么 / 我们为什么需要这个 PR?

  • 添加 SSO 相关接口

  • 管理相关接口鉴权,并移除 secret 字段

    调课:
    PUT /api/v1/course/adjust/:更新自动调课配置

    工具箱:
    GET /api/v1/toolbox/configs:管理端配置列表
    POST /api/v1/toolbox/configs:创建配置
    GET /api/v1/toolbox/configs/:id:配置详情
    PUT /api/v1/toolbox/configs/:id:更新配置
    DELETE /api/v1/toolbox/configs/:id:删除配置

    开屏页:
    POST /api/v1/launch-screen/image:创建启动图
    PUT /api/v1/launch-screen/image:替换启动图文件
    PUT /api/v1/launch-screen/image/property:修改启动图属性
    DELETE /api/v1/launch-screen/image:删除启动图
    GET /api/v1/launch-screen/image/list:管理端启动图列表

(可选)这个 PR 解决了哪个/些 issue?

对 Reviewer 预留的一些提醒

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.09346% with 64 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/admin/service/callback.go 60.65% 12 Missing and 12 partials ⚠️
pkg/cache/admin/consume_state.go 0.00% 8 Missing ⚠️
pkg/cache/admin/consume_ticket.go 0.00% 8 Missing ⚠️
internal/admin/service/login.go 62.50% 3 Missing and 3 partials ⚠️
pkg/cache/admin/set_state.go 0.00% 5 Missing ⚠️
pkg/cache/admin/set_ticket.go 0.00% 5 Missing ⚠️
pkg/base/context/admin_id.go 71.42% 2 Missing and 2 partials ⚠️
pkg/base/client/rpc.go 0.00% 2 Missing ⚠️
pkg/cache/cache.go 0.00% 1 Missing ⚠️
pkg/db/db.go 0.00% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main     #524      +/-   ##
==========================================
- Coverage   65.49%   64.02%   -1.48%     
==========================================
  Files         241      254      +13     
  Lines        6529     6754     +225     
==========================================
+ Hits         4276     4324      +48     
- Misses       2095     2257     +162     
- Partials      158      173      +15     
Flag Coverage Δ
unittest 64.02% <70.09%> (-1.48%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
api/handler/api/admin_service.go 100.00% <100.00%> (ø)
api/handler/api/common_service.go 91.82% <ø> (-0.20%) ⬇️
api/handler/api/course_service.go 97.19% <100.00%> (-2.81%) ⬇️
api/handler/api/launch_screen_service.go 98.31% <ø> (-1.69%) ⬇️
api/handler/api/user_service.go 98.19% <100.00%> (ø)
internal/admin/service/exchange_ticket.go 100.00% <100.00%> (ø)
internal/admin/service/service.go 100.00% <100.00%> (ø)
internal/common/service/list_toolbox_configs.go 78.94% <ø> (-2.01%) ⬇️
internal/common/service/manage_toolbox_config.go 76.19% <100.00%> (+5.82%) ⬆️
internal/course/service/auto_adjust_course.go 74.03% <ø> (-0.49%) ⬇️
... and 18 more

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Becks723
Becks723 marked this pull request as ready for review August 7, 2026 19:21
@Becks723
Becks723 requested review from a team, jiuxia211, mutezebra and ozline as code owners August 7, 2026 19:21
Comment thread pkg/constants/token.go Outdated
Comment thread internal/admin/service/service.go
Comment thread pkg/cache/admin/set_state.go Outdated
Comment thread api/handler/api/admin_service.go
@ACaiCat

ACaiCat commented Aug 8, 2026

Copy link
Copy Markdown
Member

部署脚本还需要加一下新的服务实例

name: Deploy to Cloud Server

SERVICES=(api user classroom course launch_screen paper academic version common oa captcha)

这里docker-run.sh好像和服务器上的不太一样了,可能需要两边分别改一下

ACaiCat
ACaiCat previously approved these changes Aug 8, 2026
@renbaoshuo
renbaoshuo self-requested a review August 8, 2026 14:41
@ACaiCat

ACaiCat commented Aug 10, 2026

Copy link
Copy Markdown
Member

hmmm,这里好像也要加一下

[ "${{ github.event.inputs.captcha }}" = "true" ] && services=$(echo $services | jq -c '. += ["captcha"]')

@Becks723
Becks723 marked this pull request as draft August 10, 2026 09:33
@Becks723 Becks723 changed the title feat: 管理面板 SSO feat: 管理面板 SSO;管理相关接口鉴权 Aug 10, 2026
@Becks723
Becks723 marked this pull request as ready for review August 10, 2026 14:15
@Becks723
Becks723 requested a review from FantasyRL as a code owner August 10, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants